package com.jiang.config;

import com.jiang.interceptor.LoginCheckIntceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private LoginCheckIntceptor loginCheckIntceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginCheckIntceptor).addPathPatterns("/**").excludePathPatterns("/login");
    }
}
